﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArticleManager.DataClasses
{
    public class Author
    {
        private int author_id;
        private string author_name;

        public override string ToString()
        {
            return this.author_name;
        }

        #region properties
        public Author()
        {
            author_id = 0;
            author_name = string.Empty;
        }

        public Author(int id, string name)
        {
            author_id = id;
            author_name = name;
        }

        public string AuthorName
        {
            get
            {
                return this.author_name;
            }
            set
            {
                this.author_name = value;
            }
        }

        public int AuthorId
        {
            get
            {
                return this.author_id;
            }
            set
            {
                this.author_id = value;
            }
        }
        #endregion

        public class Properties
        {
            public const string AuthorId = "author_id";
            public const string AuthorName = "author_name";
        }

    }

    public class AuthorsCollection : System.Collections.CollectionBase
    {
        public int Add(Author value)
        {
            return base.List.Add(value as object);
        }

        public void Remove(Author value)
        {
            base.List.Remove(value as object);
        }

        public void Insert(int index, Author value)
        {
            base.List.Insert(index, value as object);
        }

        public bool Contains(Author value)
        {
            return base.List.Contains(value as object);
        }

        public Author this[int index]
        {
            get { return base.List[index] as Author; }
        }
    }
}
